package com.zhump.springcloud.fegin.service.impl;

import com.zhump.springcloud.fegin.member.service.MemberService;
import com.zhump.springcloud.fegin.member.service.User;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 会员服务实现
 */
@RestController
public class MemberServiceImpl implements MemberService {

    @RequestMapping("/getMember")
    @Override
    public User getMember(@RequestParam("name")String name) {
        User user = new User();
        user.setName(name);
        user.setAddress("深圳市南山区");
        user.setAge("27");
        return user;
    }
    @RequestMapping("/getUserInfo")
    @Override
    public ModelMap getUserInfo(@RequestParam("name")String name) {

        try {
            Thread.sleep(1500);
        }catch (Exception e){

        }
        ModelMap modelMap = new ModelMap();
        modelMap.put("code","1");
        modelMap.put("msg",name+"会员服务。。。");
        modelMap.put("data",null);
        return modelMap;
    }
}
